import React, { Component } from 'react'
import Block from 'fs-flex';
import Style from './index.less';
import {NavBar,Icon} from 'antd-mobile'
function Header({needBack,title,history}){
    return(
        <Block className={Style.header}>
            {
                needBack?<NavBar
                    onLeftClick={()=>{history.goBack()}}
                    icon={needBack?<Icon type="left" />:null}
                    mode="dark"
                    >{title}</NavBar>
                    :<NavBar
                    mode="dark"
                    >{title}</NavBar>
            }
        </Block>
    )
}
export default Header